package com.ibeeking.gmc.global.g.rest.controller.v1.feign;

import com.ibeeking.found.common.entity.DictDTO;
import com.ibeeking.gmc.global.g.rest.service.IDictValueService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName DictValueController控制器
 * @Description
 * @Author ibeeking
 * @Date 2020-12-02 16:06
 **/
@RestController
@RequestMapping("/g/dictValue/feign/v1")
public class DictFeignController {

    @Resource
    private IDictValueService dictValueServiceImpl;

    @PostMapping(value = "/queryDictByType/{dictType}")
    public List<DictDTO> queryDictByType(@PathVariable String dictType) {
        return dictValueServiceImpl.queryDictByType(dictType);
    }

    @PostMapping(value = "/queryDictByTypes")
    public List<DictDTO> queryDictByTypes(@RequestBody String[] dictTypes) {
        return dictValueServiceImpl.queryDictByTypes(dictTypes);
    }

    @PostMapping(value = "/queryDictLable/{dictType}/{dictValue}")
    public DictDTO queryDictLable(@PathVariable String dictType, @PathVariable String dictValue) {
        return dictValueServiceImpl.queryDictLable(dictType, dictValue);
    }

    @PostMapping(value = "/queryDictLables")
    public List<DictDTO> queryDictLables(@RequestBody Map<String, String> paramMap) {
        return dictValueServiceImpl.queryDictLables(paramMap);
    }
}